//
//  ZNGConstants.h
//  开店通
//
//  Created by 张浩 on 15/6/26.
//  Copyright (c) 2015年 张浩. All rights reserved.
//

#ifndef ____ZNGConstants_h
#define ____ZNGConstants_h

#ifdef DEBUG
#define ZNGLog(format,...) NSLog(@"\n%s--line:%d\n" format, __func__, __LINE__, ##__VA_ARGS__)
//#define kServiceUrl @"http://192.168.1.123:8012"
#define kServiceUrl @"http://wms.zainagou.com"
#else
#define ZNGLog(...)
#define kServiceUrl @"http://wms.zainagou.com"
//#define kServiceUrl @"http://www.zainagou.com"
#endif

#define    kFullUrlPath(path) [NSString stringWithFormat:@"%@%@", kServiceUrl,path]

/** 颜色 */
// 透明色
#define kTransparentColor(r, g, b, a)       [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
// 不透明色
#define kColor(r, g, b)                     kTransparentColor(r, g, b, 1.0)
// 随机色
#define kRandomColor                        kColor(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))

#define kPageSize 10

#define kDocPath                            NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject

#define kScreenW                            [UIScreen mainScreen].bounds.size.width
#define kScreenH                            [UIScreen mainScreen].bounds.size.height

#define iOS7                                [UIDevice currentDevice].systemVersion.floatValue >= 7.0
#define iOSVersion                          [UIDevice currentDevice].systemVersion.floatValue

#define kFontSize(size)                     [UIFont systemFontOfSize:size]
#define kTextFont                           kFontSize(14.0)

#define kBoldFontSize(size)                     [UIFont boldSystemFontOfSize:size]
#define kBoldTextFont                           kBoldFontSize(14.0)

#define kTextSize(text, font, maxSize) [text length] > 0 ?              [text boundingRectWithSize:maxSize options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:font} context:nil].size : CGSizeZero;

#define kAttributedTextSize(text, maxSize) [text length] > 0 ?          [text boundingRectWithSize:maxSize options:(NSStringDrawingUsesLineFragmentOrigin) context:nil].size : CGSizeZero;

/** 异地登录，退出登录状态 通知 */
#define ZNGUserLogoutNotice     @"ZNGUserLogoutNotice"

#endif
